<!DOCTYPE html>
<html lang="en">
<head>
    <!-- 页面meta -->
    <meta charset="UTF-8"/>
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <title>青芽医疗管理平台</title>
    <!--    <meta content="数据采集分析系统" name="description">
        <meta content="数据采集分析系统" name="keywords">
        <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">-->

</head>
<body class="hold-transition">
<div id="app">
    <el-table size="small" current-row-key="questionOrderId" :data="questionOrderList" stripe highlight-current-row>
        <el-table-column type="index" align="center" label="序号"></el-table-column>
        <el-table-column prop="patientName" label="患者名称" align="center"></el-table-column>
        <el-table-column prop="patientPhone" label="患者电话" align="center"></el-table-column>
        <el-table-column prop="patientDescription" label="患者描述" align="center"></el-table-column>
        <el-table-column prop="doctorAdvice" label="医嘱" align="center"></el-table-column>
        <el-table-column prop="medicalId" label="药品" align="center">
            <template slot-scope="scope">
                <el-button size="mini" type="primary" @click="showMedicalList(scope.row.medicalId)">查看</el-button>
            </template>
        </el-table-column>
        <el-table-column prop="formatQuestionTime" label="就诊时间" align="center"></el-table-column>
        <el-table-column prop="totalMoney" label="总金额" align="center"></el-table-column>
        <el-table-column prop="ifTakeMedicine" label="是否取药" align="center"></el-table-column>
        <el-table-column prop="formatPayTime" label="支付时间" align="center"></el-table-column>
        <el-table-column label="操作" align="center">
            <template slot-scope="scope">
                <el-button type="primary" size="mini" @click="toAlipay2(scope.row)" v-if="scope.row.flag">取药</el-button>
            </template>
        </el-table-column>
    </el-table>

    <div class="add-form">
        <el-dialog title="查看药品" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
            <el-table size="small" current-row-key="medicalId" :data="medicalList" stripe highlight-current-row>
                <el-table-column type="index" align="center" label="序号"></el-table-column>
                <el-table-column prop="medicalName" label="药品名称" align="center"></el-table-column>
                <el-table-column prop="medicalDescribe" label="药品描述" align="center"></el-table-column>
                <el-table-column prop="medicalPrice" label="药品价格" align="center"></el-table-column>
            </el-table>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible=false">关闭</el-button>
            </div>
        </el-dialog>
    </div>
</div>
</body>
<!-- 引入组件库 -->
<script src="js/vue.js"></script>
<!--<script src="element-ui/lib/index.js"></script>-->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="js/axios-0.18.0.js"></script>
<script type="application/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            questionOrderList:[],
            medicalList:[],
            dialogFormVisible:false,
        },
        mounted() {
            this.showQuestionOrderByUserId();
        },
        methods: {
            showQuestionOrderByUserId(){
                axios.post('/questionOrder/getQuestionOrderByUserId').then(r => {
                    if(r.data==""){
                        this.$message.error('您不需要取药！！！');
                    }else {
                        this.questionOrderList = r.data;
                    }
                });
            },
            showMedicalList(row){
                this.dialogFormVisible = true;
                axios.post('/medical/getMedicalByIdList?ids='+row).then(r => {
                    this.medicalList = r.data;
                });
            },
            toAlipay2(row){
                location.href="/Alipay2/to_alipay2?questionOrderId="+row.questionOrderId+"&patientName="+row.patientName+"&patientPhone="+
                    row.patientPhone+"&totalMoney="+row.totalMoney;
            }
        },
    })
</script>
</html>